package com.niiwoo.civet.trade.enums;

/**
 * Created by lujing on 2018/4/27.
 */

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 费率配置类型枚举
 * @Author LiJian
 * @date 2018/3/1
 */
@Getter
@AllArgsConstructor
public enum RateConfigTypeEnum {

    SPEED_LOAN((byte) 1, "极速借"),
    CARD_NIU((byte) 2, "卡牛"),
    SMALL_LOAN((byte)3,"小易贷"),
    SOCIAL_SECURITY_LOAN((byte)4,"社保贷"),
    CREDIT_CARD_LOAN((byte)5,"信用卡贷");

    private Byte type;
    private String desc;

    public static RateConfigTypeEnum enumOf(int type) {
        switch (type) {
            case 1:
                return SPEED_LOAN;
            case 2:
                return CARD_NIU;
            case 3:
                return SMALL_LOAN;
            case 4:
                return SOCIAL_SECURITY_LOAN;
            case 5:
                return CREDIT_CARD_LOAN;
        }

        return null;
    }
}

